﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProblemaShowroom
{
    class Client
    {
        private string _name;
        private uint _age;

        private List<Car> _cars;

        public Client(string name, uint age)
        {
            _name = name;
            _age = age;

            _cars = new List<Car>();
        }

        public void AddCar(Car car)
        {
            _cars.Add(car);
        }

        public void GiveACar(Showroom showroom)
        {
            if (_cars.Count > 0)
            {
                Car car = _cars[0];
                _cars.RemoveAt(0);

                showroom.CollectCar(car);
            }
        }

        public void ListCars()
        {
            Console.WriteLine("Client {0} of age {1} has cars: ", Name, Age);
            foreach (var car in _cars)
            {
                Console.WriteLine("-----------------------");
                car.DisplayCar();
                Console.WriteLine("-----------------------\n");
            }
        }

        public string Name
        {
            get { return _name; }
        }

        public uint Age
        {
            get { return _age; }
        }
    }
}
